portability fixes and corrected prototypes for self-contained build
authorHans Breuer <hans@src.gnome.org>
Sun, 12 Nov 2000 15:58:18 +0000 (15:58 +0000)
committerHans Breuer <hans@src.gnome.org>
Sun, 12 Nov 2000 15:58:18 +0000 (15:58 +0000)
gdk-pixbuf/ChangeLog
gdk-pixbuf/gdk-pixbuf-io.c
gdk-pixbuf/io-xpm.c

index 89c6d2436ade788d4868fa38772e99b0c2087585..1355b8cf1e13ad7e8b10207d0561352a294520a1 100644 (file)
@@ -1,3 +1,11 @@
+2000-11-11  Hans Breuer <Hans@Breuer.Org>
+
+       * gdk-pixbuf-io.c : Fix all function prototype macros for self 
+       contained image handlers (!USE_G_MODULE). Files to save should
+       be opened in binary mode, fopen(s, "wb").
+
+       * io-xpm.c : added HAVE_UNISTD_H condition
+
 2000-11-11  Tor Lillqvist  <tml@iki.fi>
 
        * gdk_pixbuf.def: Add gdk_pixbuf_new_subpixbuf.
index ad4c29924f3fa070dc52e39a6e5a3b749de37074..bd3bbba17e338275055820a0acc4892c1efae26e 100644 (file)
@@ -349,17 +349,18 @@ gdk_pixbuf_load_module (GdkPixbufModule *image_module,
 #else
 
 #define mname(type,fn) gdk_pixbuf__ ## type ## _image_ ##fn
-#define m_load(type)  extern GdkPixbuf * mname(type,load) (FILE *f);
+#define m_load(type)  extern GdkPixbuf * mname(type,load) (FILE *f, GError **error);
 #define m_load_xpm_data(type)  extern GdkPixbuf * mname(type,load_xpm_data) (const char **data);
 #define m_begin_load(type)  \
    extern gpointer mname(type,begin_load) (ModulePreparedNotifyFunc prepare_func, \
                                 ModuleUpdatedNotifyFunc update_func, \
                                 ModuleFrameDoneNotifyFunc frame_done_func,\
                                 ModuleAnimationDoneNotifyFunc anim_done_func,\
-                                gpointer user_data);
+                                gpointer user_data,\
+                                GError **error);
 #define m_stop_load(type)  extern void mname(type,stop_load) (gpointer context);
-#define m_load_increment(type)  extern gboolean mname(type,load_increment) (gpointer context, const guchar *buf, guint size);
-#define m_load_animation(type)  extern GdkPixbufAnimation * mname(type,load_animation) (FILE *f);
+#define m_load_increment(type)  extern gboolean mname(type,load_increment) (gpointer context, const guchar *buf, guint size, GError **error);
+#define m_load_animation(type)  extern GdkPixbufAnimation * mname(type,load_animation) (FILE *f, GError **error);
 #define m_save(type) \
    extern gboolean mname(type,save) (FILE          *f, \
                                     GdkPixbuf     *pixbuf, \
@@ -857,7 +858,7 @@ gdk_pixbuf_savev (GdkPixbuf  *pixbuf,
         g_return_val_if_fail (filename != NULL, FALSE);
         g_return_val_if_fail (type != NULL, FALSE);
        
-        f = fopen (filename, "w");
+        f = fopen (filename, "wb");
         
         if (f == NULL) {
                 g_set_error (error,
index df561498f8c67ed9c537603848f6e0cfc1a5d91c..e813ae081c75610f1f49833a89165b923e45dae7 100644 (file)
@@ -27,7 +27,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <glib.h>
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h> /* for unlink */
+#endif
 #include "gdk-pixbuf-private.h"
 #include "gdk-pixbuf-io.h"